set(target "${GDMPComponentsPrefix}UiAdapter")

set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

add_library(${target} SHARED)

# 设置所在文件夹
set_target_properties(${target} PROPERTIES
    FOLDER "${GDMPComponentsSampleFolder}"
    OUTPUT_NAME "GDMPComponentsSampleUiAdapter"
)

file(GLOB_RECURSE SOURCE_FILES
    LIST_DIRECTORIES False CONFIGURE_DEPENDS
    "${SOURCE_DIR}/*.h*"
    "${SOURCE_DIR}/*.c*"
)

target_sources(${target} PRIVATE
    ${SOURCE_FILES}
)

if(MSVC)
    target_compile_definitions(${target}
        PRIVATE UNICODE NOMINMAX
    )
endif()

# 指定头文件路径
target_include_directories(${target}
    PUBLIC "$<BUILD_INTERFACE:${SOURCE_DIR}>"
)

# 配置Qt依赖
find_package(Qt5 COMPONENTS Widgets Xml REQUIRED)
set_target_properties(${target} PROPERTIES
    AUTOMOC ON
    AUTOUIC ON
)

target_link_libraries(${target} PRIVATE
    Qt5::Widgets 	Qt5::Xml 
    Gcmp::All
    Gdmp::foundation.ui
    Gdmp::foundation.db
)
